package com.easondongh.blog.dao;

import com.easondongh.blog.pojo.CommentGoods;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author EasonDongH
 * @date 2020/4/9 8:35
 */
@Repository
public interface CommentGoodsDao extends MongoRepository<CommentGoods, String> {

    /**
     * 根据用户id和评论d统计
     * @param userId
     * @param commentId
     * @return
     */
    int countByUserIdAndCommentId(Integer userId, String commentId);

    /**
     * 根据用户id和博客id查询
     * @param userId
     * @param blogId
     * @return
     */
    List<CommentGoods> findByUserIdAndBlogId(Integer userId, String blogId);

    /**
     * 根据用户id查询
     * @param userId
     * @return
     */
    List<CommentGoods> findByUserId(Integer userId);
}
